package com.warmheart.base.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * 
 * @ClassName: AliSmsConfiguration
 * @Description: 阿里云短信服务参数配置
 * @author ZhangJianyang
 * @date 2025-06-16 09:37:02
 *
 */
@Configuration
@AutoConfigureAfter({ AliSmsConfig.class })
public class AliSmsConfiguration {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Bean
    public AliSmsService aliSmsService(AliSmsConfig aliSmsConfig) {
        return new AliSmsService(stringRedisTemplate) {

            @Override
            public AliSmsConfig config() {
                return aliSmsConfig;
            }
        };
    }

}
